package controller;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Delegator {
	
	final static int PORT = 0xcafe;
	
	public static void main(String [] args){

		try{
			ServerSocket server = new ServerSocket(PORT);
			Socket s;
			
			while(true){
				System.out.println( "Warte" );
				s = server.accept();
				System.out.println( "Verbindung akzeptiert: " + s );
				
				ServerThread t = new ServerThread(s);
				t.start();
				System.out.println("Ende");
			}
		} 
		catch(IOException e){
			e.printStackTrace();
		}
	}
}
